﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    public class tbKhachHang
    {
        private string makh;

        public string Makh
        {
            get { return makh; }
            set { makh = value; }
        }
        private string tenkh;

        public string Tenkh
        {
            get { return tenkh; }
            set { tenkh = value; }
        }
        private string ngaysinh;

        public string Ngaysinh
        {
            get { return ngaysinh; }
            set { ngaysinh = value; }
        }
        private string email;

        public string Email
        {
            get { return email; }
            set { email = value; }
        }
        private string tendn;

        public string Tendn
        {
            get { return tendn; }
            set { tendn = value; }
        }
        private string matkhau;

        public string Matkhau
        {
            get { return matkhau; }
            set { matkhau = value; }
        }

        DBAccess db = new DBAccess();
        public DataTable dalDSKhachHang()
        {
            string query = "HienThiKH";
            SqlParameter[] param = new SqlParameter[0];
            return db.GetDataTable(query, CommandType.StoredProcedure, param);
        }

        public bool dalXoaKH()
        {
            bool res = false;
            string query = "XoaKH";
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@MaKH", Makh);
            res = db.DoExcecute(query, CommandType.StoredProcedure, param);
            return res;
        }
    }
}
